home *** CD-ROM | disk | FTP | other *** search
- // prmpt.cpp -- Prompt for value between 1 and 100
-
- #include <iostream.h>
-
- main()
- {
- int goodResponse = 0;
- int response;
-
-
- while (!goodResponse) {
- cout << "Enter value from 1 to 100: ";
- cin >> response;
- goodResponse = ((1 <= response) && (response <= 100));
- if (!goodResponse)
- cout << "ERROR: Try again!\n";
- }
- cout << "Final value == " << response;
- }
-
-
- // Copyright (c) 1990 by Tom Swan. All rights reserved
- // Revision 1.00 Date: 10/24/1990 Time: 07:10 am
-
- // Revision 1.01 Date: 07/08/1991 Time: 05:41 pm
- // Converted for Borland C++ 2.0
-
-